package edu.uwm.capstone.diasmart.types;

import android.app.Activity;
import android.content.Intent;
import android.view.View;
import android.widget.TableRow;
import edu.uwm.capstone.diasmart.R;
import edu.uwm.capstone.diasmart.database.DatabaseHelper;
import edu.uwm.capstone.diasmart.database.Entry;

public class BodyFatType extends BaseType {

	public TableRow[] getUserInterface(Activity activity) {
		return EditableEntryTypeHelper.getStandardUserInterface(activity, this,
				R.id.edtBodyFatValue, R.id.sprBodyFatSubType);
	}

	public boolean handleOnActivityResult(Activity activity, int paramInt1,
			int paramInt2, Intent paramIntent) {

		return EditableEntryTypeHelper.handleOnActivityResult(activity,
				getType(), R.id.sprBodyFatSubType, paramInt1, paramInt2,
				paramIntent);
	}

	public long save(DatabaseHelper dbh, Entry entry, View view) {
		return EditableEntryTypeHelper.saveStandard(dbh, this, entry, view,
				R.id.edtBodyFatValue, R.id.sprBodyFatSubType);
	}

	public int validate(View view) {
		return EditableEntryTypeHelper.validateStandard(this, view,
				R.id.edtBodyFatValue, R.id.sprBodyFatSubType);
	}

	public int validate(EntryContext entryContext, String value) {

		return EditableEntryTypeHelper.validateStandard(
				entryContext.getContext(), value);
	}

	public String toString() {
		return "Body Fat";

	}

	public int getType() {
		return 8;
	}

}
